/*

This file is part of Zephyr.

    Zephyr is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Zephyr is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Zephyr.  If not, see <http://www.gnu.org/licenses/>.

*/

#include "openconnection.h"
#include <QFile>
#include <QTextStream>
#include "ui_openconnection.h"

openConnection::openConnection(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::openConnection)
{
    ui->setupUi(this);
    int n = 0;
    QFile savedConnectionFile("savedConnections.ini");
    savedConnectionFile.open(QIODevice::ReadOnly);
    QTextStream inputStream(&savedConnectionFile);
    QString inputString = "ROFLMAO";
    // this loop should grab the connection names from the saved connections file and put them in the combo box
    while(inputString != QString())
    {
        inputString = inputStream.readLine(n);
        ui->comboBox->addItem(inputString);
        inputString = inputStream.readLine(n+1);
        if(inputString == QString())
        {
            break;
        }
        n=n+10;
    }
}

openConnection::~openConnection()
{
    delete ui;
}
